﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication9
{
    class Program
    {
        public static void ShowShowable(IShowable sh)
        {
            sh.ShowLine();
        }

        // Кубо работы
        public static void CubeWork(int CountOfCubes) 
        {
            cube[] cubeArr = new cube[CountOfCubes];
            Random r = new Random();

            for (int i = 0; i < cubeArr.Length; i++) 
            {
                cubeArr[i] = new cube();
                cubeArr[i].SetX(r.Next(1, 5));
                cubeArr[i].ShowValue();
            }

            
  
        }

        static void Main(string[] args)
        {
            Box[] box_my = new Box[10];

            line[] l = new line[10];

            Random rnd = new Random();

            for (int i = 0; i < l.Length; i++) 
            {
                l[i] = new line();
                box_my[i] = new Box(rnd.Next(1,10), rnd.Next(1,10), rnd.Next(1,10));
                l[i].setA(rnd.Next(100));            
            }

            Array.Sort(l);


            for (int i = 0; i < l.Length; i++)
            {
                l[i].ShowA();
                Console.WriteLine("box {0} = {1}",i,box_my[i].GetVolume());
                ShowShowable(l[i]);
            }


            CubeWork(3);

            Console.ReadLine();
        }
    }
}
